﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EstimateLib
{
    public class EstimateResult
    {
        private DomainNameLengthLevel lenLevel;
        private DomainNameMeaningLevel meanLevel;
        private DomainSufixLevel surfixLevel;

        public EstimateResult(DomainNameLengthLevel lenLevel, DomainNameMeaningLevel meanLevel, DomainSufixLevel surfixLevel)
        {
            
            this.lenLevel = lenLevel;
            this.meanLevel = meanLevel;
            this.surfixLevel = surfixLevel;
            CaculateValue();
        }

        private void CaculateValue()
        {
            string Key = lenLevel.ToString() + "-" + meanLevel.ToString();
           // Level = ValueDic[Key];
            Level = GetLenStr() + GetMeaningStr()+" "+ValueDic[Key]; //"★☆";

        }

        private object GetMeaningStr()
        {
            switch (meanLevel)
            {
                case DomainNameMeaningLevel.A: return "☆☆☆☆";
                case DomainNameMeaningLevel.B:return "☆☆☆";
                case DomainNameMeaningLevel.C:return "☆☆";
                case DomainNameMeaningLevel.D:return "☆";
                case DomainNameMeaningLevel.E:return "";
                default:return "";
            }
        }

        private string GetLenStr()
        {
            switch (lenLevel)
            {
                case DomainNameLengthLevel.A: return "★★★★";

                case DomainNameLengthLevel.B: return "★★★";

                case DomainNameLengthLevel.C: return "★★";

                case DomainNameLengthLevel.D: return "★";
                   
                case DomainNameLengthLevel.E: return "";
                   
                default: return "";
                    
            }
        }

      
        private static Dictionary<string, string> ValueDic = new Dictionary<string, string>();

        static EstimateResult()
        {

            ValueDic = new Dictionary<string, string>();

            ValueDic.Add("A-A","50万-1000万");
            ValueDic.Add("A-B", "20万-500万");
            ValueDic.Add("A-C", "1万-15万");
            ValueDic.Add("A-D", "5千-5万");
            ValueDic.Add("A-E", "0-2万");

            ValueDic.Add("B-A", "30万-500万");
            ValueDic.Add("B-B", "5万-100万");
            ValueDic.Add("B-C", "5千-10万");
            ValueDic.Add("B-D", "3千-2.5万");
            ValueDic.Add("B-E", "0-1.5万");

            ValueDic.Add("C-A", "5万-100万");
            ValueDic.Add("C-B", "3万-50万");
            ValueDic.Add("C-C", "3千-7.5万");
            ValueDic.Add("C-D", "3千-2.5万");
            ValueDic.Add("C-E", "0-1万");

            ValueDic.Add("D-A", "1万-25万");
            ValueDic.Add("D-B", "5千-5万");
            ValueDic.Add("D-C", "1千-4万");
            ValueDic.Add("D-D", "1千-2万");
            ValueDic.Add("D-E", "0-1万");

            ValueDic.Add("E-A", "0-5万");
            ValueDic.Add("E-B", "0-2万");
            ValueDic.Add("E-C", "0-1.5万");
            ValueDic.Add("E-D", "0-1.5万");
            ValueDic.Add("E-E", "0-1万");
            


        }

        public string Level { get; private set; }
    }
}
